<!--
  Generated template for the DeviceWhPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-title *ngIf="type == 1">添加设备</ion-title>
    <ion-title *ngIf="type == 2">维护设备</ion-title>
  </ion-navbar>

</ion-header>


<ion-content padding>
    <!--<div padding>-->
        <!--<button ion-button color="primary" ion-button block (click)="chooseFile()">选择</button>-->
        <!--<button ion-button color="primary" ion-button block (click)="saveFile()">保存</button>-->
    <!--</div>-->

    <!--<img [src]="actionParam.imageUrl" alt="" width="200" height="200">-->
    <!--<p>{{actionParam.imageUrl}}</p>-->
    <ion-list>
        <ion-list-header>
            <font size="3" color="blue">基础信息（必填）</font>
        </ion-list-header>
        <ion-item>
            <ion-label >设备编号</ion-label>
            <ion-input [(ngModel)]="actionParam.physicalCode" placeholder="输入设备编号" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >设备名称</ion-label>
            <ion-input [(ngModel)]="actionParam.name" placeholder="输入设备名称" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label>省份</ion-label>
            <ion-select [(ngModel)]="actionParam.provinceCode"  (ngModelChange)="changeProvince()" placeholder="输入省份" okText="确定" cancelText="取消">
                <ion-option *ngFor="let item of provinceArr" [value]="item.provinceCode">{{item.name}}</ion-option>
            </ion-select>
        </ion-item>

        <ion-item>
            <ion-label>地市</ion-label>
            <ion-select [(ngModel)]="actionParam.cityCode" (ngModelChange)="changeCity()" placeholder="输入地市" okText="确定" cancelText="取消">
                <ion-option *ngFor="let item of cityArr" [value]="item.cityCode">{{item.name}}</ion-option>
            </ion-select>
        </ion-item>

        <ion-item>
            <ion-label>区县</ion-label>
            <ion-select [(ngModel)]="actionParam.districtCode" okText="确定" placeholder="输入区县" cancelText="取消">
                <ion-option *ngFor="let item of districtArr" [value]="item.districtCode">{{item.name}}</ion-option>
            </ion-select>
        </ion-item>

        <ion-item>
            <ion-label>农场</ion-label>
            <ion-select [(ngModel)]="actionParam.farmId" okText="确定"  placeholder="输入农场" cancelText="取消">
                <ion-option *ngFor="let item of farmArr" [value]="item.id">{{item.name}}</ion-option>
            </ion-select>
        </ion-item>

        <ion-item>
            <ion-label >SIM卡号</ion-label>
            <ion-input [(ngModel)]="actionParam.logicalCode" placeholder="输入SIM卡号" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >SIM有效期</ion-label>
            <ion-datetime displayFormat="YYYY-MM-DD" [(ngModel)]="actionParam.expireTime" placeholder="输入SIM有效期" okText="确定" cancelText="取消"></ion-datetime>
        </ion-item>

        <ion-item>
            <ion-label >套餐流量(M)</ion-label>
            <ion-input [(ngModel)]="actionParam.planFlow" placeholder="输入套餐流量（M）" type="number"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >经度</ion-label>
            <ion-input [(ngModel)]="actionParam.longitude" placeholder="输入经度" type="number"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >纬度</ion-label>
            <ion-input [(ngModel)]="actionParam.latitude" placeholder="输入维度" type="number"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >地址</ion-label>
            <ion-input [(ngModel)]="actionParam.address" placeholder="输入地址" type="text"></ion-input>
        </ion-item>


        <br>
        <br>
        <ion-list-header>
            <font size="3" color="blue">铺设信息（选填）</font>
        </ion-list-header>

        <ion-item>
            <ion-label >业务员</ion-label>
            <ion-input [(ngModel)]="actionParam.salesMan" placeholder="输入业务员" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >业务员电话</ion-label>
            <ion-input [(ngModel)]="actionParam.salesPhone" placeholder="输入业务员电话" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >维修人</ion-label>
            <ion-input [(ngModel)]="actionParam.maintenanceMan" placeholder="输入维修人" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >维修人电话</ion-label>
            <ion-input [(ngModel)]="actionParam.maintenancePhone" placeholder="输入维修人电话" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >铺设人</ion-label>
            <ion-input [(ngModel)]="actionParam.buildMan" placeholder="输入铺设人" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >铺设人电话</ion-label>
            <ion-input [(ngModel)]="actionParam.buildPhone" placeholder="输入铺设人电话" type="text"></ion-input>
        </ion-item>

        <ion-item>
            <ion-label >铺设日期</ion-label>
            <ion-datetime displayFormat="YYYY-MM-DD" [(ngModel)]="actionParam.buildTime" placeholder="输入铺设日期" okText="确定" cancelText="取消"></ion-datetime>
        </ion-item>

        <ion-item>
            <ion-label >描述</ion-label>
            <ion-input [(ngModel)]="actionParam.description" placeholder="输入描述" type="text"></ion-input>
        </ion-item>

        <div padding>
            <button ion-button color="primary" ion-button block (click)="submitData()">保存</button>
        </div>
    </ion-list>


</ion-content>
